/**
 * @description 注册
 */
//公用样式 
require('../../assets/css/index.less');

//引入weui库
require('../../assets/lib/weui/weui.css');
let weui = require('../../assets/lib/weui/weui.js');
//引入图标
require('../../assets/fonts/iconfont.css');
//当前页面样式
require('./circle.less');

//工具函数 utils
const dom = require('../../utils/dom');
const local = require('../../utils/local.js');
//引入axios封装的文件
let https = require('../../utils/https.js');

dom.isLogin()



//DOM加载事件
dom.ready(function () {
    //调用底部菜单
    dom.bMenu('circle')
    let imgurl = require('../../assets/imgs/liuying.jpg')
    let imgurd = require('../../assets/imgs/denghan.jpg')
    let imgurs = require('../../assets/imgs/xiaoliu.jpg')
    let imgurr = require('../../assets/imgs/xiaoliu2.jpg')
    let imgurm = require('../../assets/imgs/majiaxi.jpg')
    let imgurc = require('../../assets/imgs/majiaxi2.jpg')
    let imgurf = require('../../assets/imgs/majiaxi3.jpg')
function getCircleinfo(){
    https.get('/api/circles/opinionList',function(res){
        let {errno,data} = res;
        if(errno==0){
            console.log(data);
            data.filter(function(v){
                console.log(v);
                //1只有内容没有图像
                if (v.content && (!v.imgUrls || v.imgUrls.length == 0)) {
                    dom.getEle('#list').innerHTML += `
                    <li>
                    <div class="User Versioncenter">
                      <div class="Useravatar">
                        <img src="${imgurd}" class="sioncenter">
                        <div>
                          <h4>邓韩</h4>
                        <p>四川省, 成都市</p>
                        </div>
                        <div class="usertext">
                        <p class="mt20">${v.content}</p>
                        </div>
                      </div>
                     
                    </div>
                </li>
                    `
                }
                if (v.content && (!v.imgUrls || v.imgUrls.length == 0)) {
                    dom.getEle('#list').innerHTML += `
                    <li>
                    <div class="User Versioncenter">
                      <div class="Useravatar">
                        <img src="${imgurl}" class="sioncenter">
                        <div>
                          <h4>刘颖</h4>
                        <p>四川省, 成都市</p>
                        </div>
                        <div class="usertext">
                        <p class="mt20">${v.content}</p>
                        </div>
                        <div class="Sendicture">
                        <img src="${imgurs}" alt="">
                        <img src="${imgurs}" alt="">
                        <img src="${imgurs}" alt="">
                        </div>
                      </div>
                     
                    </div>
                </li>
                    `
                }
                if (v.content && (!v.imgUrls || v.imgUrls.length == 0)) {
                    dom.getEle('#list').innerHTML += `
                    <li>
                    <div class="User Versioncenter">
                      <div class="Useravatar">
                        <img src="${imgurm}" class="sioncenter">
                        <div>
                          <h4>马嘉禧</h4>
                        <p>四川省, 成都市</p>
                        </div>
                      
                        <div class="Sendicture">
                        <img src="${imgurr}" alt="">
                        <img src="${imgurc}" alt="">
                        <img src="${imgurf}" alt="">
                        </div>
                      </div>
                     
                    </div>
                </li>
                    `
                }
                
            })
        }
    })
}
getCircleinfo()

})
